
**********************************************************************
*** MERGE the two NAMELIST
**********************************************************************


use "$root/Data/Original/Grunddaten_merge.dta", clear

merge m:1  Name Adress using "$root/Data/Original/EV_names_merge_new.dta"
keep if _merge==3 

drop Name _ 

duplicates drop PID, force
reshape long VID, i(PID) j(temp)

drop temp
drop if VID==. | PID ==.

duplicates drop PID VID, force

bys VID: egen long minPID = min(PID)

drop if PID!=minPID


 
save "$root/Data/Original/VID_PID_adress_new.dta", replace

